home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 16 / CU Amiga Magazine's Super CD-ROM 16 (1997-10-16)(EMAP Images)(GB)[!][issue 1997-11].iso / CUCD / Graphics / Ghostscript / batch / ps2pdf < prev    next >
Text File  |  1997-08-14  |  524b  |  33 lines

  1. #!/bin/sh
  2. # Convert PostScript to PDF.
  3.  
  4. OPTIONS=""
  5. while true
  6. do
  7.     case "$1" in
  8.     -*) OPTIONS="$OPTIONS $1" ;;
  9.     *)  break ;;
  10.     esac
  11.     shift
  12. done
  13.  
  14. if [ $# -lt 1 -o $# -gt 2 ]; then
  15.     echo "Usage: `basename $0` [options...] input.ps [output.pdf]" 1>&2
  16.     exit 1
  17. fi
  18.  
  19. infile=$1;
  20.  
  21. if [ $# -eq 1 ]
  22. then
  23.     case "${infile}" in
  24.       *.ps)        base=`basename ${infile} .ps` ;;
  25.       *)        base=`basename ${infile}` ;;
  26.     esac
  27.     outfile=${base}.pdf
  28. else
  29.     outfile=$2
  30. fi
  31.  
  32. exec gs -q -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=$outfile $OPTIONS $infile -c quit
  33.